#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void removeSpace(char* s)
{
	char *p = s;
	char *q = s;	

	while( *q != '\0'){
		if( p != q)
		{
			*p = *q;			
		}
		
		if (*p != ' ')
			p++;

		q++;
	}
	*p = '\0';
}

int main(int argc, char const *argv[])
{
	char str[] = "abc   def  hig    ccc";
	printf("%s\n", str);
	removeSpace(str);
	printf("%s\n", str);
	return 0;
}